<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //声明一个数组
    let arr = ['a','b','c','d'];

    //获取迭代器对象  Symbol.iterator
    let iterator = arr[Symbol.iterator]();

    console.log(iterator.next()); // {value: 'xx', done: false}
    console.log(iterator.next());
    console.log(iterator.next());
    console.log(iterator.next());
    console.log(iterator.next());

    // for...of  专门用来遍历可迭代的数据
    // for(let v of arr){
    //   console.log(v);
    // }
  </script>
</body>
</html>